<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLogNewGuidesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        Schema::create('log_new_guides', function (Blueprint $table) {
            $table->increments('id');
            $table->date('date_time')->comment('日期');
            $table->smallInteger('server_id')->comment('区服id');
            $table->smallInteger('first_task_undone')->comment('未完成第一步新手引导');
            $table->float('first_task_undone_wash')->comment('新手引导第一步流失率');
            $table->smallInteger('first_task_finish')->comment('完成第一步新手引导数量');
            $table->float('first_task_finish_wash')->comment('完成第一步新手引导率');
            $table->smallInteger('task_finish_all')->comment('完成所有新手引导数量');
            $table->float('task_finish_all_wash')->comment('完成所有新手引导率');
            $table->unique(['date_time', 'server_id']);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down()
    {
        Schema::dropIfExists('log_new_guides');
    }
}
